module.exports = {
    publicPath: './', //相对路径
    outputDir: 'dist', //构建输出目录
    assetsDir: 'assets', //静态资源目录
    // baseUrl: '/',
    devServer: {
        open: true, //使用npm run serve之后是否自动在浏览器中打开项目
        host: 'localhost', //主机名字
        port: 8081, //端口号
        https: false,
        hotOnly: false,
        proxy: {
            //配置跨域，请求接口
            '/api': {
                target: 'http://localhost:7001/pvm-service',
                ws: true, //是否跨域
                changeOrigin: true,
                pathRewrite: {
                    '^/api': ''
                }
            }
        }
    },
    configureWebpack: {
        resolve: { extensions: [".ts", ".tsx", ".js", ".json"] },
        module: {
            rules: [
                {
                    test: /\.tsx?$/,
                    loader: 'ts-loader',
                    exclude: /node_modules/,
                    options: {
                        appendTsSuffixTo: [/\.vue$/],
                    }
                }
            ]
        }
    },
    css: {
        loaderOptions: {
            sass: {
                data: `@import "@/assets/scss/var.scss";`
            }
        }
    }
}
